import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);


export default new Vuex.Store({
	state: {
		versions: 'v1.2.8',
		// 微信的胶囊信息 or H5的固定信息
		search:{
			bottom: 80,
			height: 32,
			left: 281,
			right: 368,
			top: 48,
			width: 87
		},
		// 上传图片配置对象
		ossSignData: {},
		user: {}
	},
	mutations: {
		updataUser(state, data) {
			state.user = JSON.parse(JSON.stringify(data));
			uni.setStorageSync('user', JSON.stringify(data));
		},
		updataSearch(state, data) {
			state.search = JSON.parse(JSON.stringify(data));
			uni.setStorageSync('search', JSON.stringify(data));
		},
		updataOssSignData(state, data) {
			state.ossSignData = JSON.parse(JSON.stringify(data));
		},
	},
	actions: {

	},
	modules: {}
})
